﻿using System;
using Moe.ECamel.Common.Entities;

namespace Moe.ECamel.Common.Contracts
{
	/// <summary>
	/// Contract for users services.
	/// </summary>
	public interface IUserService : IECamelService
	{
		/// <summary>
		/// Creates a new user.
		/// </summary>
		/// <param name="user">User details.</param>
		/// <returns>If successful - null, otherwise validation error.</returns>
		ECamelError CreateUser(User user);
		/// <summary>
		/// Updates a user.
		/// </summary>
		/// <param name="user">User details.</param>
		/// <returns>If successful - null, otherwise validation error.</returns>
		ECamelError UpdateUser(User user);
		/// <summary>
		/// Change a user's password.
		/// </summary>
		/// <param name="userId">User to change password.</param>
		/// <param name="oldPassword">Old password</param>
		/// <param name="newPassword">New password</param>
		/// <returns></returns>
		ECamelError ChangeUserPassword(int userId, byte[] oldPassword, byte[] newPassword);
	}
}
